.class public Lrexsee/fileSelector/FileAdapter;
.super Landroid/widget/BaseAdapter;
.source "FileAdapter.java"


# instance fields
.field private final fileIcon:Landroid/graphics/drawable/Drawable;

.field public final fileList:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Ljava/io/File;",
            ">;"
        }
    .end annotation
.end field

.field public final folderIcon:Landroid/graphics/drawable/Drawable;

.field public final mBrowser:Lrexsee/core/browser/Browser;

.field private final mSelector:Lrexsee/fileSelector/RexseeFileSelector;


# direct methods
.method public constructor <init>(Lrexsee/core/browser/Browser;Lrexsee/fileSelector/RexseeFileSelector;)V
    .locals 3
    .param p1, "browser"    # Lrexsee/core/browser/Browser;
    .param p2, "selector"    # Lrexsee/fileSelector/RexseeFileSelector;

    .prologue
    const/4 v2, 0x0

    .line 34
    invoke-direct {p0}, Landroid/widget/BaseAdapter;-><init>()V

    .line 32
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lrexsee/fileSelector/FileAdapter;->fileList:Ljava/util/ArrayList;

    .line 35
    iput-object p1, p0, Lrexsee/fileSelector/FileAdapter;->mBrowser:Lrexsee/core/browser/Browser;

    .line 36
    iput-object p2, p0, Lrexsee/fileSelector/FileAdapter;->mSelector:Lrexsee/fileSelector/RexseeFileSelector;

    .line 37
    iget-object v0, p0, Lrexsee/fileSelector/FileAdapter;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v1, p0, Lrexsee/fileSelector/FileAdapter;->mSelector:Lrexsee/fileSelector/RexseeFileSelector;

    iget-object v1, v1, Lrexsee/fileSelector/RexseeFileSelector;->mFolderIcon:Ljava/lang/String;

    invoke-static {v0, v1, v2}, Lrexsee/core/style/RexseeDrawable;->getDrawable(Lrexsee/core/browser/Browser;Ljava/lang/String;Landroid/graphics/drawable/Drawable;)Landroid/graphics/drawable/Drawable;

    move-result-object v0

    iput-object v0, p0, Lrexsee/fileSelector/FileAdapter;->folderIcon:Landroid/graphics/drawable/Drawable;

    .line 38
    iget-object v0, p0, Lrexsee/fileSelector/FileAdapter;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v1, p0, Lrexsee/fileSelector/FileAdapter;->mSelector:Lrexsee/fileSelector/RexseeFileSelector;

    iget-object v1, v1, Lrexsee/fileSelector/RexseeFileSelector;->mFileIcon:Ljava/lang/String;

    invoke-static {v0, v1, v2}, Lrexsee/core/style/RexseeDrawable;->getDrawable(Lrexsee/core/browser/Browser;Ljava/lang/String;Landroid/graphics/drawable/Drawable;)Landroid/graphics/drawable/Drawable;

    move-result-object v0

    iput-object v0, p0, Lrexsee/fileSelector/FileAdapter;->fileIcon:Landroid/graphics/drawable/Drawable;

    .line 39
    return-void
.end method

.method private setFileIcon(Landroid/widget/ImageView;Ljava/lang/String;)V
    .locals 7
    .param p1, "imageView"    # Landroid/widget/ImageView;
    .param p2, "path"    # Ljava/lang/String;

    .prologue
    const/4 v6, 0x1

    .line 42
    const-string v4, "."

    invoke-virtual {p2, v4}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v4

    add-int/lit8 v4, v4, 0x1

    invoke-virtual {p2, v4}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object v1

    .line 43
    .local v1, "ext":Ljava/lang/String;
    iget-object v4, p0, Lrexsee/fileSelector/FileAdapter;->mSelector:Lrexsee/fileSelector/RexseeFileSelector;

    invoke-virtual {v4, p2}, Lrexsee/fileSelector/RexseeFileSelector;->isImage(Ljava/lang/String;)Z

    move-result v4

    if-eqz v4, :cond_2

    .line 44
    iget-object v4, p0, Lrexsee/fileSelector/FileAdapter;->mSelector:Lrexsee/fileSelector/RexseeFileSelector;

    iget-object v4, v4, Lrexsee/fileSelector/RexseeFileSelector;->mIcons:Ljava/util/HashMap;

    if-eqz v4, :cond_1

    iget-object v4, p0, Lrexsee/fileSelector/FileAdapter;->mSelector:Lrexsee/fileSelector/RexseeFileSelector;

    iget-object v4, v4, Lrexsee/fileSelector/RexseeFileSelector;->mIcons:Ljava/util/HashMap;

    invoke-virtual {v4, v1}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_1

    .line 45
    iget-object v4, p0, Lrexsee/fileSelector/FileAdapter;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v5, p0, Lrexsee/fileSelector/FileAdapter;->mSelector:Lrexsee/fileSelector/RexseeFileSelector;

    iget-object v5, v5, Lrexsee/fileSelector/RexseeFileSelector;->mIcons:Ljava/util/HashMap;

    invoke-virtual {v5, v1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object p0

    .end local p0    # "this":Lrexsee/fileSelector/FileAdapter;
    check-cast p0, Ljava/lang/String;

    invoke-static {v4, p0}, Lrexsee/core/style/RexseeDrawable;->getDrawable(Lrexsee/core/browser/Browser;Ljava/lang/String;)Landroid/graphics/drawable/Drawable;

    move-result-object v4

    invoke-virtual {p1, v4}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 65
    :cond_0
    :goto_0
    return-void

    .line 47
    .restart local p0    # "this":Lrexsee/fileSelector/FileAdapter;
    :cond_1
    new-instance v2, Ljava/io/File;

    invoke-static {p2}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v4

    invoke-virtual {v4}, Landroid/net/Uri;->getSchemeSpecificPart()Ljava/lang/String;

    move-result-object v4

    invoke-direct {v2, v4}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 48
    .local v2, "file":Ljava/io/File;
    if-eqz v2, :cond_0

    invoke-virtual {v2}, Ljava/io/File;->isFile()Z

    move-result v4

    if-eqz v4, :cond_0

    invoke-virtual {v2}, Ljava/io/File;->canRead()Z

    move-result v4

    if-eqz v4, :cond_0

    .line 49
    new-instance v3, Landroid/graphics/BitmapFactory$Options;

    invoke-direct {v3}, Landroid/graphics/BitmapFactory$Options;-><init>()V

    .line 50
    .local v3, "options":Landroid/graphics/BitmapFactory$Options;
    iput-boolean v6, v3, Landroid/graphics/BitmapFactory$Options;->inJustDecodeBounds:Z

    .line 51
    invoke-virtual {v2}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v4

    invoke-static {v4, v3}, Landroid/graphics/BitmapFactory;->decodeFile(Ljava/lang/String;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 52
    .local v0, "bitmap":Landroid/graphics/Bitmap;
    const/4 v4, 0x0

    iput-boolean v4, v3, Landroid/graphics/BitmapFactory$Options;->inJustDecodeBounds:Z

    .line 53
    iget v4, v3, Landroid/graphics/BitmapFactory$Options;->outHeight:I

    div-int/lit8 v4, v4, 0x5a

    iget v5, v3, Landroid/graphics/BitmapFactory$Options;->outWidth:I

    div-int/lit8 v5, v5, 0x5a

    invoke-static {v4, v5}, Ljava/lang/Math;->max(II)I

    move-result v4

    int-to-float v4, v4

    invoke-static {v4}, Ljava/lang/Math;->round(F)I

    move-result v4

    invoke-static {v6, v4}, Ljava/lang/Math;->max(II)I

    move-result v4

    iput v4, v3, Landroid/graphics/BitmapFactory$Options;->inSampleSize:I

    .line 54
    invoke-virtual {v2}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v4

    invoke-static {v4, v3}, Landroid/graphics/BitmapFactory;->decodeFile(Ljava/lang/String;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 55
    invoke-virtual {p1, v0}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V

    goto :goto_0

    .line 59
    .end local v0    # "bitmap":Landroid/graphics/Bitmap;
    .end local v2    # "file":Ljava/io/File;
    .end local v3    # "options":Landroid/graphics/BitmapFactory$Options;
    :cond_2
    iget-object v4, p0, Lrexsee/fileSelector/FileAdapter;->mSelector:Lrexsee/fileSelector/RexseeFileSelector;

    iget-object v4, v4, Lrexsee/fileSelector/RexseeFileSelector;->mIcons:Ljava/util/HashMap;

    if-eqz v4, :cond_3

    iget-object v4, p0, Lrexsee/fileSelector/FileAdapter;->mSelector:Lrexsee/fileSelector/RexseeFileSelector;

    iget-object v4, v4, Lrexsee/fileSelector/RexseeFileSelector;->mIcons:Ljava/util/HashMap;

    invoke-virtual {v4, v1}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_3

    .line 60
    iget-object v4, p0, Lrexsee/fileSelector/FileAdapter;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v5, p0, Lrexsee/fileSelector/FileAdapter;->mSelector:Lrexsee/fileSelector/RexseeFileSelector;

    iget-object v5, v5, Lrexsee/fileSelector/RexseeFileSelector;->mIcons:Ljava/util/HashMap;

    invoke-virtual {v5, v1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object p0

    .end local p0    # "this":Lrexsee/fileSelector/FileAdapter;
    check-cast p0, Ljava/lang/String;

    invoke-static {v4, p0}, Lrexsee/core/style/RexseeDrawable;->getDrawable(Lrexsee/core/browser/Browser;Ljava/lang/String;)Landroid/graphics/drawable/Drawable;

    move-result-object v4

    invoke-virtual {p1, v4}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    goto :goto_0

    .line 62
    .restart local p0    # "this":Lrexsee/fileSelector/FileAdapter;
    :cond_3
    iget-object v4, p0, Lrexsee/fileSelector/FileAdapter;->fileIcon:Landroid/graphics/drawable/Drawable;

    invoke-virtual {p1, v4}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    goto :goto_0
.end method


# virtual methods
.method public getCount()I
    .locals 1

    .prologue
    .line 138
    iget-object v0, p0, Lrexsee/fileSelector/FileAdapter;->fileList:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    return v0
.end method

.method public getItem(I)Ljava/lang/Object;
    .locals 1
    .param p1, "position"    # I

    .prologue
    .line 142
    invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v0

    return-object v0
.end method

.method public getItemId(I)J
    .locals 2
    .param p1, "position"    # I

    .prologue
    .line 146
    int-to-long v0, p1

    return-wide v0
.end method

.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 11
    .param p1, "position"    # I
    .param p2, "convertView"    # Landroid/view/View;
    .param p3, "parent"    # Landroid/view/ViewGroup;

    .prologue
    const-string v10, "file://"

    .line 91
    iget-object v7, p0, Lrexsee/fileSelector/FileAdapter;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {v7}, Lrexsee/core/browser/Browser;->getContext()Landroid/content/Context;

    move-result-object v1

    .line 92
    .local v1, "context":Landroid/content/Context;
    if-nez p2, :cond_0

    .line 93
    new-instance p2, Landroid/widget/LinearLayout;

    .end local p2    # "convertView":Landroid/view/View;
    invoke-direct {p2, v1}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;)V

    .line 95
    .restart local p2    # "convertView":Landroid/view/View;
    :cond_0
    move-object v0, p2

    check-cast v0, Landroid/widget/LinearLayout;

    move-object v4, v0

    .line 96
    .local v4, "layout":Landroid/widget/LinearLayout;
    invoke-virtual {v4}, Landroid/widget/LinearLayout;->removeAllViews()V

    .line 97
    const/4 v7, 0x0

    invoke-virtual {v4, v7}, Landroid/widget/LinearLayout;->setOrientation(I)V

    .line 98
    const/16 v7, 0x10

    invoke-virtual {v4, v7}, Landroid/widget/LinearLayout;->setGravity(I)V

    .line 100
    new-instance v3, Landroid/widget/ImageView;

    invoke-direct {v3, v1}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V

    .line 101
    .local v3, "icon":Landroid/widget/ImageView;
    iget-object v7, p0, Lrexsee/fileSelector/FileAdapter;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v8, p0, Lrexsee/fileSelector/FileAdapter;->mSelector:Lrexsee/fileSelector/RexseeFileSelector;

    iget-object v8, v8, Lrexsee/fileSelector/RexseeFileSelector;->mSelector:Lrexsee/fileSelector/RexseeFileSelector$FileSelector;

    iget-object v8, v8, Lrexsee/fileSelector/RexseeFileSelector$FileSelector;->styleSheet:Lrexsee/core/style/StyleSheet;

    invoke-static {v7, v3, v8}, Lrexsee/natives/ViewStyle;->setImageViewStyle(Lrexsee/core/browser/Browser;Landroid/widget/ImageView;Lrexsee/core/style/StyleSheet;)V

    .line 102
    iget-object v7, p0, Lrexsee/fileSelector/FileAdapter;->mSelector:Lrexsee/fileSelector/RexseeFileSelector;

    iget-object v7, v7, Lrexsee/fileSelector/RexseeFileSelector;->mSelector:Lrexsee/fileSelector/RexseeFileSelector$FileSelector;

    iget-object v7, v7, Lrexsee/fileSelector/RexseeFileSelector$FileSelector;->styleSheet:Lrexsee/core/style/StyleSheet;

    invoke-virtual {v7}, Lrexsee/core/style/StyleSheet;->getIconLayoutParams()Landroid/widget/LinearLayout$LayoutParams;

    move-result-object v7

    invoke-virtual {v3, v7}, Landroid/widget/ImageView;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    .line 103
    invoke-virtual {v4, v3}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;)V

    .line 105
    iget-object v7, p0, Lrexsee/fileSelector/FileAdapter;->fileList:Ljava/util/ArrayList;

    invoke-virtual {v7, p1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/io/File;

    .line 106
    .local v2, "file":Ljava/io/File;
    invoke-virtual {v2}, Ljava/io/File;->isDirectory()Z

    move-result v7

    if-eqz v7, :cond_2

    .line 107
    iget-object v7, p0, Lrexsee/fileSelector/FileAdapter;->folderIcon:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v3, v7}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 108
    new-instance v5, Landroid/widget/TextView;

    invoke-direct {v5, v1}, Landroid/widget/TextView;-><init>(Landroid/content/Context;)V

    .line 109
    .local v5, "name":Landroid/widget/TextView;
    iget-object v7, p0, Lrexsee/fileSelector/FileAdapter;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v8, p0, Lrexsee/fileSelector/FileAdapter;->mSelector:Lrexsee/fileSelector/RexseeFileSelector;

    iget-object v8, v8, Lrexsee/fileSelector/RexseeFileSelector;->mUnselectedStyle:Lrexsee/core/style/StyleSheet;

    invoke-static {v7, v5, v8}, Lrexsee/natives/ViewStyle;->setTextViewStyle(Lrexsee/core/browser/Browser;Landroid/widget/TextView;Lrexsee/core/style/StyleSheet;)V

    .line 110
    iget-object v7, p0, Lrexsee/fileSelector/FileAdapter;->mSelector:Lrexsee/fileSelector/RexseeFileSelector;

    iget-object v7, v7, Lrexsee/fileSelector/RexseeFileSelector;->mUnselectedStyle:Lrexsee/core/style/StyleSheet;

    invoke-virtual {v7}, Lrexsee/core/style/StyleSheet;->getLabelLayoutParams()Landroid/widget/LinearLayout$LayoutParams;

    move-result-object v7

    invoke-virtual {v5, v7}, Landroid/widget/TextView;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    .line 111
    invoke-virtual {v2}, Ljava/io/File;->getName()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v5, v7}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 112
    invoke-virtual {v4, v5}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;)V

    .line 133
    :cond_1
    :goto_0
    return-object v4

    .line 114
    .end local v5    # "name":Landroid/widget/TextView;
    :cond_2
    new-instance v7, Ljava/lang/StringBuilder;

    const-string v8, "file://"

    invoke-direct {v7, v10}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v7

    invoke-direct {p0, v3, v7}, Lrexsee/fileSelector/FileAdapter;->setFileIcon(Landroid/widget/ImageView;Ljava/lang/String;)V

    .line 115
    new-instance v5, Landroid/widget/TextView;

    invoke-direct {v5, v1}, Landroid/widget/TextView;-><init>(Landroid/content/Context;)V

    .line 116
    .restart local v5    # "name":Landroid/widget/TextView;
    new-instance v6, Landroid/widget/ImageView;

    invoke-direct {v6, v1}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V

    .line 117
    .local v6, "select":Landroid/widget/ImageView;
    iget-object v7, p0, Lrexsee/fileSelector/FileAdapter;->mSelector:Lrexsee/fileSelector/RexseeFileSelector;

    iget-object v7, v7, Lrexsee/fileSelector/RexseeFileSelector;->mSelection:Ljava/util/ArrayList;

    new-instance v8, Ljava/lang/StringBuilder;

    const-string v9, "file://"

    invoke-direct {v8, v10}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v9

    invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v8

    invoke-virtual {v8}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v7, v8}, Ljava/util/ArrayList;->contains(Ljava/lang/Object;)Z

    move-result v7

    if-eqz v7, :cond_3

    .line 118
    iget-object v7, p0, Lrexsee/fileSelector/FileAdapter;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v8, p0, Lrexsee/fileSelector/FileAdapter;->mSelector:Lrexsee/fileSelector/RexseeFileSelector;

    iget-object v8, v8, Lrexsee/fileSelector/RexseeFileSelector;->mSelectedStyle:Lrexsee/core/style/StyleSheet;

    invoke-static {v7, v5, v8}, Lrexsee/natives/ViewStyle;->setTextViewStyle(Lrexsee/core/browser/Browser;Landroid/widget/TextView;Lrexsee/core/style/StyleSheet;)V

    .line 119
    iget-object v7, p0, Lrexsee/fileSelector/FileAdapter;->mSelector:Lrexsee/fileSelector/RexseeFileSelector;

    iget-object v7, v7, Lrexsee/fileSelector/RexseeFileSelector;->mSelectedStyle:Lrexsee/core/style/StyleSheet;

    invoke-virtual {v7}, Lrexsee/core/style/StyleSheet;->getLabelLayoutParams()Landroid/widget/LinearLayout$LayoutParams;

    move-result-object v7

    invoke-virtual {v5, v7}, Landroid/widget/TextView;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    .line 120
    invoke-virtual {v2}, Ljava/io/File;->getName()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v5, v7}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 121
    iget-object v7, p0, Lrexsee/fileSelector/FileAdapter;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v8, p0, Lrexsee/fileSelector/FileAdapter;->mSelector:Lrexsee/fileSelector/RexseeFileSelector;

    iget-object v8, v8, Lrexsee/fileSelector/RexseeFileSelector;->mSelectedStyle:Lrexsee/core/style/StyleSheet;

    invoke-static {v7, v6, v8}, Lrexsee/natives/ViewStyle;->setImageViewStyle(Lrexsee/core/browser/Browser;Landroid/widget/ImageView;Lrexsee/core/style/StyleSheet;)V

    .line 122
    iget-object v7, p0, Lrexsee/fileSelector/FileAdapter;->mSelector:Lrexsee/fileSelector/RexseeFileSelector;

    iget-object v7, v7, Lrexsee/fileSelector/RexseeFileSelector;->mSelectedStyle:Lrexsee/core/style/StyleSheet;

    invoke-virtual {v7}, Lrexsee/core/style/StyleSheet;->getIconLayoutParams()Landroid/widget/LinearLayout$LayoutParams;

    move-result-object v7

    invoke-virtual {v6, v7}, Landroid/widget/ImageView;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    .line 130
    :goto_1
    invoke-virtual {v4, v5}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;)V

    .line 131
    iget-object v7, p0, Lrexsee/fileSelector/FileAdapter;->mSelector:Lrexsee/fileSelector/RexseeFileSelector;

    iget-boolean v7, v7, Lrexsee/fileSelector/RexseeFileSelector;->mMultiple:Z

    if-eqz v7, :cond_1

    invoke-virtual {v4, v6}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;)V

    goto :goto_0

    .line 124
    :cond_3
    iget-object v7, p0, Lrexsee/fileSelector/FileAdapter;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v8, p0, Lrexsee/fileSelector/FileAdapter;->mSelector:Lrexsee/fileSelector/RexseeFileSelector;

    iget-object v8, v8, Lrexsee/fileSelector/RexseeFileSelector;->mUnselectedStyle:Lrexsee/core/style/StyleSheet;

    invoke-static {v7, v5, v8}, Lrexsee/natives/ViewStyle;->setTextViewStyle(Lrexsee/core/browser/Browser;Landroid/widget/TextView;Lrexsee/core/style/StyleSheet;)V

    .line 125
    iget-object v7, p0, Lrexsee/fileSelector/FileAdapter;->mSelector:Lrexsee/fileSelector/RexseeFileSelector;

    iget-object v7, v7, Lrexsee/fileSelector/RexseeFileSelector;->mUnselectedStyle:Lrexsee/core/style/StyleSheet;

    invoke-virtual {v7}, Lrexsee/core/style/StyleSheet;->getLabelLayoutParams()Landroid/widget/LinearLayout$LayoutParams;

    move-result-object v7

    invoke-virtual {v5, v7}, Landroid/widget/TextView;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    .line 126
    invoke-virtual {v2}, Ljava/io/File;->getName()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v5, v7}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 127
    iget-object v7, p0, Lrexsee/fileSelector/FileAdapter;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v8, p0, Lrexsee/fileSelector/FileAdapter;->mSelector:Lrexsee/fileSelector/RexseeFileSelector;

    iget-object v8, v8, Lrexsee/fileSelector/RexseeFileSelector;->mUnselectedStyle:Lrexsee/core/style/StyleSheet;

    invoke-static {v7, v6, v8}, Lrexsee/natives/ViewStyle;->setImageViewStyle(Lrexsee/core/browser/Browser;Landroid/widget/ImageView;Lrexsee/core/style/StyleSheet;)V

    .line 128
    iget-object v7, p0, Lrexsee/fileSelector/FileAdapter;->mSelector:Lrexsee/fileSelector/RexseeFileSelector;

    iget-object v7, v7, Lrexsee/fileSelector/RexseeFileSelector;->mUnselectedStyle:Lrexsee/core/style/StyleSheet;

    invoke-virtual {v7}, Lrexsee/core/style/StyleSheet;->getIconLayoutParams()Landroid/widget/LinearLayout$LayoutParams;

    move-result-object v7

    invoke-virtual {v6, v7}, Landroid/widget/ImageView;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    goto :goto_1
.end method

.method public load(Ljava/lang/String;)V
    .locals 8
    .param p1, "url"    # Ljava/lang/String;

    .prologue
    const-string v7, "/"

    .line 68
    iget-object v5, p0, Lrexsee/fileSelector/FileAdapter;->fileList:Ljava/util/ArrayList;

    invoke-virtual {v5}, Ljava/util/ArrayList;->clear()V

    .line 69
    const-string v5, "file:///android_asset/"

    invoke-virtual {p1, v5}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v5

    if-eqz v5, :cond_1

    .line 87
    :cond_0
    return-void

    .line 70
    :cond_1
    new-instance v1, Ljava/io/File;

    invoke-static {p1}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v5

    invoke-virtual {v5}, Landroid/net/Uri;->getSchemeSpecificPart()Ljava/lang/String;

    move-result-object v5

    invoke-direct {v1, v5}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 71
    .local v1, "file":Ljava/io/File;
    invoke-virtual {v1}, Ljava/io/File;->exists()Z

    move-result v5

    if-eqz v5, :cond_0

    .line 72
    invoke-virtual {v1}, Ljava/io/File;->isDirectory()Z

    move-result v5

    if-eqz v5, :cond_0

    .line 73
    invoke-virtual {v1}, Ljava/io/File;->canRead()Z

    move-result v5

    if-eqz v5, :cond_0

    .line 75
    invoke-virtual {v1}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v4

    .line 76
    .local v4, "path":Ljava/lang/String;
    invoke-virtual {v1}, Ljava/io/File;->list()[Ljava/lang/String;

    move-result-object v3

    .line 77
    .local v3, "list":[Ljava/lang/String;
    sget-object v5, Ljava/util/Locale;->CHINA:Ljava/util/Locale;

    invoke-static {v5}, Ljava/text/Collator;->getInstance(Ljava/util/Locale;)Ljava/text/Collator;

    move-result-object v5

    invoke-static {v3, v5}, Ljava/util/Arrays;->sort([Ljava/lang/Object;Ljava/util/Comparator;)V

    .line 78
    const/4 v2, 0x0

    .local v2, "i":I
    :goto_0
    array-length v5, v3

    if-lt v2, v5, :cond_3

    .line 82
    const/4 v2, 0x0

    :goto_1
    array-length v5, v3

    if-ge v2, v5, :cond_0

    .line 83
    new-instance v0, Ljava/io/File;

    new-instance v5, Ljava/lang/StringBuilder;

    invoke-static {v4}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v6

    invoke-direct {v5, v6}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v6, "/"

    invoke-virtual {v5, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    aget-object v6, v3, v2

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-direct {v0, v5}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 84
    .local v0, "child":Ljava/io/File;
    invoke-virtual {v0}, Ljava/io/File;->isFile()Z

    move-result v5

    if-eqz v5, :cond_2

    iget-object v5, p0, Lrexsee/fileSelector/FileAdapter;->mSelector:Lrexsee/fileSelector/RexseeFileSelector;

    aget-object v6, v3, v2

    invoke-virtual {v5, v6}, Lrexsee/fileSelector/RexseeFileSelector;->isValidFile(Ljava/lang/String;)Z

    move-result v5

    if-eqz v5, :cond_2

    iget-object v5, p0, Lrexsee/fileSelector/FileAdapter;->fileList:Ljava/util/ArrayList;

    invoke-virtual {v5, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 82
    :cond_2
    add-int/lit8 v2, v2, 0x1

    goto :goto_1

    .line 79
    .end local v0    # "child":Ljava/io/File;
    :cond_3
    new-instance v0, Ljava/io/File;

    new-instance v5, Ljava/lang/StringBuilder;

    invoke-static {v4}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v6

    invoke-direct {v5, v6}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v6, "/"

    invoke-virtual {v5, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    aget-object v6, v3, v2

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-direct {v0, v5}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 80
    .restart local v0    # "child":Ljava/io/File;
    invoke-virtual {v0}, Ljava/io/File;->isDirectory()Z

    move-result v5

    if-eqz v5, :cond_4

    iget-object v5, p0, Lrexsee/fileSelector/FileAdapter;->fileList:Ljava/util/ArrayList;

    invoke-virtual {v5, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 78
    :cond_4
    add-int/lit8 v2, v2, 0x1

    goto :goto_0
.end method
